package org.dydl.controller.system;

import java.util.List;

import javax.servlet.http.HttpServletResponse;

import org.dydl.common.util.ExportExcelByPoiUtilTest;
import org.dydl.model.system.vo.ExportVO;
import org.dydl.service.system.IBusinessListService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/api/export")
public class ExportController {
	@Autowired
	private IBusinessListService businessListService;
	
	/**
	 * 导出
	 *
	 * @param response
	 */
	@RequestMapping(value = "/exportList")
	public void exportExcel(HttpServletResponse response,@RequestParam(value = "businessId", required = false) String businessId){
	    List<ExportVO> exportList = businessListService.getExportList("F1579489737179");
//	    List<ExportVO> exportList = businessListService.getExportList(businessId);
	    
	    ExportExcelByPoiUtilTest.exportExcel(exportList, "营业厅设备清单", "设备清单.xls", ExportVO.class, "设备清单.xls", response);
	}
	

}
